# -*- coding: utf-8 -*-
'''
Created on 2018年6月19日
@author: liaolzl
'''
#1.requests实例引入
import requests
response = requests.get('https://www.baidu.com/')
print(type(response))
print(response.status_code)
print(type(response.text))
print(response.text)
print(response.cookies)

#2.requests的各种请求方式
import requests
requests.post('http://httpbin.org/post')
requests.put('http://httpbin.org/put')
requests.delete('http://httpbin.org/delete')
requests.head('http://httpbin.org/get')
requests.options('http://httpbin.org/get')

#3（1）.requests的基本get请求
import requests
response = requests.get('http://httpbin.org/get')
print(response.text)
#3（2）（一）.requests的带参数get请求
import requests
response = requests.get('http://hhtpbin.org/get?name=germey&age=22')
print(response.text)
#3（2）（二）.requests的带参数get请求
import requests
data = {
    'name':'germey',
    'age':22
}
response = requests.get('http://httpbin.org/get',params=data)
print(response.text)